//
//  WelcomeViewController.m
//  DataStatistics
//
//  Created by 123456 on 16/6/30.
//  Copyright © 2016年 YTYangK. All rights reserved.
//

#import "WelcomeViewController.h"
#import "SDCycleScrollView.h"
#import "LoginVC.h"


@interface WelcomeViewController ()<SDCycleScrollViewDelegate>
{
    UIButton *btn;

}

@property (weak, nonatomic) IBOutlet SDCycleScrollView *WelcomeScroll;

@end

@implementation WelcomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    [self welcome];


}



-(void)welcome
{

    NSArray *arr = @[@"2.pic_hd",@"1.pic_hd"];
    
    self.WelcomeScroll.imageURLStringsGroup =arr;
    self.WelcomeScroll.delegate = self;
    self.WelcomeScroll.autoScroll = NO;//自动循环滚动
    self.WelcomeScroll.showPageControl =YES;//page点
    self.WelcomeScroll.infiniteLoop = NO;//实现循环轮播;
    
    
}


//滚动回调的方法
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index{
    
}

//点击图片回调的方法
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index;
{
    if (index == 1) {
        UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Login" bundle:nil];
        
        //在获取storyboard中的视图控制器
        LoginVC *vc = [storyBoard instantiateViewControllerWithIdentifier:@"LoginVC"];
        vc.modalPresentationStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentViewController:vc animated:YES completion:nil];
         self.rootWindow.rootViewController = vc;
        
        
        //设置已经访问的标志位
        [[NSUserDefaults standardUserDefaults]setObject:@"YES" forKey:@"isHaveVisit"];

    }
    
}




@end
